package jmu.cze.until;

import java.util.UUID;

public class UUIDUtil {
    public static String getFileName(String fileName){
        if (fileName!=null) {
            if (fileName.endsWith("jpg")) {
                return generateUUID() + ".jpg";
            } else if (fileName.endsWith("png")) {
                return generateUUID() + ".png";
            }
        }
        return null;
    }

    public static String generateUUID() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

}